# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2020 Bonainfo <guoyihot@outlook.com>
# All Rights Reserved
#
##############################################################################
import logging

from odoo import api, models, fields, _
from odoo.exceptions import UserError

_logger = logging.getLogger(__name__)


class FieldConfig(models.Model):
    _name = "field.config"

    name = fields.Char("字段名")
    string = fields.Char("字段显示名")
    width = fields.Float('字段宽度')
    res_model = fields.Char("模型")
    invisible = fields.Boolean("是否在视图中显示")
    act_id = fields.Integer("动作窗口id")
    view_id = fields.Integer("视图id")
    form_field = fields.Char("form视图中用于显示list的字段")
    user_id = fields.Integer('用户')
    sequence = fields.Integer('顺序')
    is_field = fields.Boolean('是否是字段', default=True)


class ListConfig(models.Model):
    _name = "list.config"

    act_id = fields.Integer("动作窗口id")
    view_id = fields.Integer("视图id")
    res_model = fields.Char("模型")
    user_id = fields.Integer('用户')
    form_field = fields.Char("form视图中用于显示list的字段")
    name = fields.Char("配置名称")
    value = fields.Char("配置值")
    string = fields.Char('配置显示名')
